﻿using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace TFS.Kanban.VS2010.Queries
{
    public class WorkItemQuery : WIQLQuery<WorkItem>
    {
        public WorkItemQuery(WorkItemStore workItemStore) : base(workItemStore)
        {
        }

        protected override string Table
        {
            get { return "WorkItems"; }
        }

        protected override string MapFieldName(string propertyName)
        {
            string result;

            if(propertyName == GetPropertyName(x => x.Type))
            {
                result = "Work Item Type";
            }
            else if(propertyName == GetPropertyName(x => x.IterationPath))
            {
                result = "Iteration Path";
            }
            else
            {
                result = base.MapFieldName(propertyName);
            }

            return result;
        }
    }
}
